/**
 * DSM - Distributed Search Manager
 * Developed by Education.AU Ltd
 * $Author: vhobbs $
 * $Revision: 1.1 $
 * $Date: 2008/02/11 12:03:17 $
 * (c)Copyright 2008
 * education.au limited
 * DEST
 * All rights reserved.
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 * Redistributions of source code must retain the above copyright notice, this
 * list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright notice,
 * this list of conditions and the following disclaimer in the documentation
 * and/or other materials provided with the distribution.
 * Neither the names education.au limited, DEST nor the names of its
 * contributors may be used to endorse or promote products derived from this
 * software without specific prior written permission.
 * To the extent permitted by law, the copyright owners of this software and
 * its contributors:
 * (i) exclude all warranties in relation to the software; and
 * (ii) exclude liability for all losses, costs, expenses and damages arising
 * in any way from the use of the software whether arising from or in
 * relation to breach of contract, negligence or any other tort, in equity
 * or otherwise. If the software is in breach of a warranty which is
 * implied by law, the copyright owners and contributors liability is
 * limited to the replacement of the software.
 *
 * @author	vhobbs
 * 
 */
package au.edu.educationau.opensource.dsm.worker;

import au.edu.educationau.opensource.dsm.obj.SearchResult;

public class ResultCrosswalker {

	/**
	 * Adapter property name suffixes for crosswalk specifications.
	 * 
	 * Eg. 
	 * adapter2.metadata.crosswalk.title=dc_title
	 * 
	 * specifies that the DSM Result title field should be crosswalked from the dc_title field 
	 * of the delegate result.
	 */
	public static final String PROPERTY_SUFFIX_TITLE_CROSSWALK = ".metadata.crosswalk.title";
	public static final String PROPERTY_SUFFIX_DESCRIPTION_CROSSWALK = ".metadata.crosswalk.description";
	public static final String PROPERTY_SUFFIX_IDENTIFIER_CROSSWALK = ".metadata.crosswalk.identifier";
	public static final String PROPERTY_SUFFIX_CATEGORY_CROSSWALK = ".metadata.crosswalk.category";
	public static final String PROPERTY_SUFFIX_COLLECTION_CROSSWALK = ".metadata.crosswalk.collection";
	public static final String PROPERTY_SUFFIX_DATE_CROSSWALK = ".metadata.crosswalk.date";
	public static final String PROPERTY_SUFFIX_DATEFORMAT_CROSSWALK = ".metadata.crosswalk.date.format";
	public static final String PROPERTY_SUFFIX_RELEVANCE_CROSSWALK = ".metadata.crosswalk.relevance";
	public static final String PROPERTY_SUFFIX_RIGHTS_CROSSWALK = ".metadata.crosswalk.rights";
	public static final String PROPERTY_SUFFIX_SOURCE_CROSSWALK = ".metadata.crosswalk.source";
	
	/**
	 * Looks up metadata crosswalks for the given search adapter, and performs the crosswalk 
	 * on the supplied SearchResult object.
	 * 
	 * @param result the SearchResult to crosswalk
	 * @param adapterCode the name of the SearchAdapter
	 * 
	 * @return supplied SearchResult, with metadata fields crosswalked into the appropriate  
	 * 		   SearchResult attributes
	 */
	public static SearchResult crosswalkResult(SearchResult result, String adapterCode) {
		
		//TODO: Hoist SolrContentHandler crosswalk code out here for general use.
		return result;
	}
}
